<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area" @click="goPublish">
			<text class="title">{{title}}</text>
		</view>
		<view>
			{{arg}}
		</view>
		<view @click="setFun(999)" style="margin-top: 100px;">测试</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				arg:'123'
			}
		},
		onLoad() {

		},
		created() {
			window.setFun = this.setFun;
		},
		methods: {
			
			setFun(arg) {
				alert("获取到android的传参:" + arg);
				this.arg = arg;
				console.log("获取到android的传参:" + arg);
			},
			goPublish() {
				console.log('阿斯顿发送到发送到发斯蒂芬斯蒂芬');
				//将vue项目引入至安卓代码中，安卓方法暴露在window中，vue中可以直接用window去调取方法。
				window.android.test()
			},
			test() {
				console.log('asdfasdf');
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>